hfrApp.registerCtrl("DashboardController", function ($scope, $modal, $http, $log, $window, $rootScope, HfrConfig, HfrStorage, HfrInit) {
	
	//Display meta header
	HfrConfig.displayMeta("dashboard");
	
	//Get total site
	var blogUrl = HfrConfig.ApiServiceUrl.blogsUrlApi + "?customerId=" + $rootScope.username;
	$http.get(blogUrl)
		.success(function (data) {
			console.log(data);
			if (data.status == 200) {
				$scope.totalBlogs = $scope.sizeOf(data.response.blogs);
			} else {
				$scope.totalBlogs = 0;
			};
		})
		.error(function (data) {
			$rootScope.message.error = true;
			$rootScope.message.text = "Can't connect to server to get customer info";
		});
	
	//Count size
	$scope.sizeOf = function(obj) {
	    return Object.keys(obj).length;
	};
	
});